import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { WalletOrderTransactionVO, WalletOrderTransactionForm, WalletOrderTransactionQuery } from '@/api/mushcoin/walletOrderTransaction/types';

/**
 * 查询TG钱包订单交易(Ton...)列表
 * @param query
 * @returns {*}
 */

export const listWalletOrderTransaction = (query?: WalletOrderTransactionQuery): AxiosPromise<WalletOrderTransactionVO[]> => {
  return request({
    url: '/mushcoin/walletOrderTransaction/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询TG钱包订单交易(Ton...)详细
 * @param id
 */
export const getWalletOrderTransaction = (id: string | number): AxiosPromise<WalletOrderTransactionVO> => {
  return request({
    url: '/mushcoin/walletOrderTransaction/' + id,
    method: 'get'
  });
};

/**
 * 新增TG钱包订单交易(Ton...)
 * @param data
 */
export const addWalletOrderTransaction = (data: WalletOrderTransactionForm) => {
  return request({
    url: '/mushcoin/walletOrderTransaction',
    method: 'post',
    data: data
  });
};

/**
 * 修改TG钱包订单交易(Ton...)
 * @param data
 */
export const updateWalletOrderTransaction = (data: WalletOrderTransactionForm) => {
  return request({
    url: '/mushcoin/walletOrderTransaction',
    method: 'put',
    data: data
  });
};

/**
 * 删除TG钱包订单交易(Ton...)
 * @param id
 */
export const delWalletOrderTransaction = (id: string | number | Array<string | number>) => {
  return request({
    url: '/mushcoin/walletOrderTransaction/' + id,
    method: 'delete'
  });
};
/**
 * 修改TG钱包订单交易-支付成功
 * @param data
 */
export const updateWalletOrderTransactionPayOk = (id: string | number | Array<string | number>) => {
  return request({
    url: '/mushcoin/walletOrderTransaction/payOk/' + id,
    method: 'post'
  });
};
